package com.nebula.seckill.config;

import org.springframework.data.redis.core.RedisTemplate;

/**
 * @Author: llq
 * @Date: 2019/9/24
 */
public class ThreadB extends Thread {
    private MsService service;
    private RedisTemplate<String,Object> redisTemplate;
    private String key;

    public ThreadB(MsService service,RedisTemplate<String,Object> redisTemplate,String key) {
        this.service = service;
        this.redisTemplate=redisTemplate;
        this.key=key;
    }

    @Override
    public void run() {
        try {
            service.seckill(redisTemplate, key);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}
